//
//  Http.swift
//  TT_Swift
//
//  Created by Lenny on 16/5/11.
//  Copyright © 2016年 Lenny. All rights reserved.
//

import AFNetworking

class Http: NSObject {

    func getDate() {
        
        let manager:AFHTTPSessionManager = AFHTTPSessionManager();
        let str:String = "http://api.fnbird.com/mobile/index.php?act=index&op=commonInfo"
        
        manager.GET(str, parameters: nil, progress: { (pro) -> Void in
            
            NSLog("\(pro)")
            }, success: { (task:NSURLSessionDataTask!, obj) -> Void in
                
                let dic:NSDictionary = obj as! NSDictionary
                let datas:NSDictionary = dic["datas"] as! NSDictionary
                NSLog("\(obj),datas=\(datas),d=\(datas["serviceTel"])")
                print("success")
                
            }) { (task:NSURLSessionDataTask?, error:NSError) -> Void in
                
                print("failed")
        }
    }
}
